import { List } from "immutable";
import { MAP_LOADING, MAP_READY, MAP_ROLL_START, MAP_ROLLING, MAP_ROLL_STOP } from "../constants/MapConst";

const mapReady = () => ({ type: MAP_READY });
const mapLoading = (inData: List<List<number>>, inFrom: number) => ({
    type: MAP_LOADING,
    payload: {
        data: inData,
        from: inFrom
    }
});
const mapRollStart = () => ({ type: MAP_ROLL_START});
const mapRolling = (inData: List<List<number>>, inShape: string, coordinate: Game.ICoordinate) => ({
    type: MAP_ROLLING,
    payload: {
        data: inData,
        shape: inShape,
        coordinate
    }
});
const mapRollStop = () => ({ type: MAP_ROLL_STOP });

export default {
    mapReady,
    mapLoading,
    mapRollStart,
    mapRolling,
    mapRollStop,
};
